package com.ebao.po.blog;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ebao.constants.UserType;

/**
 * @desc 分享博文
 * @author snow
 * @date 2012-7-10
 */
@Entity
@Table(name = "T_Share_Blog")
public class TShareBlog implements Serializable {

	private static final long serialVersionUID = -75935481870164522L;
	
	private Long id;
	private Long blogId;			// 分享的博文Id
	private UserType sharerType;	// 分享者类型user/doctor
	private String sharerId;		// 分享者Id
	private String shareDate;		// 分享的日期
	private List<TBlogComment> blogComments = new ArrayList<TBlogComment>();	// 分享的博文的评论

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getBlogId() {
		return blogId;
	}

	public void setBlogId(Long blogId) {
		this.blogId = blogId;
	}

	public UserType getSharerType() {
		return sharerType;
	}

	public void setSharerType(UserType sharerType) {
		this.sharerType = sharerType;
	}

	public String getSharerId() {
		return sharerId;
	}

	public void setSharerId(String sharerId) {
		this.sharerId = sharerId;
	}

	@Column(length = 19)
	public String getShareDate() {
		return shareDate;
	}

	public void setShareDate(String shareDate) {
		this.shareDate = shareDate;
	}

	@OneToMany(cascade = {CascadeType.ALL}, mappedBy = "shareBlog", targetEntity = TBlogComment.class)
	public List<TBlogComment> getBlogComments() {
		return blogComments;
	}

	public void setBlogComments(List<TBlogComment> blogComments) {
		this.blogComments = blogComments;
	}
	
}
